# define _CRT_SECURE_NO_WARNINGS 1
# include<stdio.h>

int compare(int x, int y)
{
	int n = 0;
	int count = 0;
	n = x ^ y;
	while (n)
	{
		n = n & (n - 1);
		count++;
	}
	return count;
}

int main()
{
	int x = 0;
	int y = 0;

	scanf("%d%d", &x, &y);
	int ret = compare(x, y);
	printf("%d", ret);

	return 0;
}